package com.rest.demo.mybatisdemo.service.impl;

import com.rest.demo.mybatisdemo.entity.Account;
import com.rest.demo.mybatisdemo.mapper.AccountMapper;
import com.rest.demo.mybatisdemo.service.IAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Administrator
 * @decription
 * @Date 2017-11-14 16:00
 */
@Service
public class AccountServiceImpl implements IAccountService {

    @Autowired
    private AccountMapper accountMapper;

    @Override
    public int add(String name, double money) {
        return accountMapper.add(name,money);
    }

    @Override
    public int update(String name, double money, int id) {
        return accountMapper.update(name,money,id);
    }

    @Override
    public int delete(int id) {
        return accountMapper.delete(id);
    }

    @Override
    public Account findAccount(int id) {
        return accountMapper.findAccount(id);
    }

    @Override
    public List<Account> findAccountList() {
        return accountMapper.findAccountList();
    }
}
